﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：YS_SF_QUXIAOTSTPRZ实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class YS_SF_QUXIAOTSTPRZ
    {
        private double? m_db_n_jine;

        private decimal m_dec_i_chulir;

        private decimal m_dec_i_feiyongbh;

        private decimal m_dec_i_huizhongbh;

        private decimal m_dec_i_jlzt;

        private decimal m_dec_i_m;

        private decimal? m_dec_i_print;

        private decimal m_dec_i_tichubz;

        private decimal? m_dec_i_tuoshoulx;

        private decimal m_dec_i_tuoshoupzh;

        private decimal m_dec_i_y;

        private decimal m_dec_id;

        private DateTime m_DT_d_quxiaorq;

        private string m_str_s_beiyong1;

        private string m_str_s_beiyong2;

        private string m_str_s_down;

        private string m_str_s_guanlikbh;

        private string m_str_s_kaihuhm;

        private string m_str_s_kaihuyh;

        private string m_str_s_kaihuzh;

        private string m_str_s_up;

        private string m_str_s_yonghuh;

        private string m_str_s_yonghum;

        private string m_str_s_zhandianbh;

        /// <summary>
        ///     i_CancelID  主键
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        ///     D_CancelDate 取消日期
        /// </summary>
        public DateTime D_QUXIAORQ
        {
            get { return m_DT_d_quxiaorq; }
            set { m_DT_d_quxiaorq = value; }
        }

        /// <summary>
        ///     i_clr 处理人
        /// </summary>
        public decimal I_CHULIR
        {
            get { return m_dec_i_chulir; }
            set { m_dec_i_chulir = value; }
        }

        /// <summary>
        ///     i_tspzh 托收凭证号
        /// </summary>
        public decimal I_TUOSHOUPZH
        {
            get { return m_dec_i_tuoshoupzh; }
            set { m_dec_i_tuoshoupzh = value; }
        }

        /// <summary>
        ///     i_hzid汇总编号
        /// </summary>
        public decimal I_HUIZHONGBH
        {
            get { return m_dec_i_huizhongbh; }
            set { m_dec_i_huizhongbh = value; }
        }

        /// <summary>
        ///     C_st站点
        /// </summary>
        public string S_ZHANDIANBH
        {
            get { return m_str_s_zhandianbh; }
            set { m_str_s_zhandianbh = value; }
        }

        /// <summary>
        ///     Feeid费用编号
        /// </summary>
        public decimal I_FEIYONGBH
        {
            get { return m_dec_i_feiyongbh; }
            set { m_dec_i_feiyongbh = value; }
        }

        /// <summary>
        ///     c_UserID用户编号
        /// </summary>
        public string S_YONGHUH
        {
            get { return m_str_s_yonghuh; }
            set { m_str_s_yonghuh = value; }
        }

        /// <summary>
        ///     C_Areacode管理快号
        /// </summary>
        public string S_GUANLIKBH
        {
            get { return m_str_s_guanlikbh; }
            set { m_str_s_guanlikbh = value; }
        }

        /// <summary>
        ///     i_y年
        /// </summary>
        public decimal I_Y
        {
            get { return m_dec_i_y; }
            set { m_dec_i_y = value; }
        }

        /// <summary>
        ///     i_m月
        /// </summary>
        public decimal I_M
        {
            get { return m_dec_i_m; }
            set { m_dec_i_m = value; }
        }

        /// <summary>
        ///     c_UserName用户名
        /// </summary>
        public string S_YONGHUM
        {
            get { return m_str_s_yonghum; }
            set { m_str_s_yonghum = value; }
        }

        /// <summary>
        ///     n_je金额
        /// </summary>
        public double? N_JINE
        {
            get { return m_db_n_jine; }
            set { m_db_n_jine = value; }
        }

        /// <summary>
        ///     c_AccName开户户名
        /// </summary>
        public string S_KAIHUHM
        {
            get { return m_str_s_kaihuhm; }
            set { m_str_s_kaihuhm = value; }
        }

        /// <summary>
        ///     c_AccNo开户账号
        /// </summary>
        public string S_KAIHUZH
        {
            get { return m_str_s_kaihuzh; }
            set { m_str_s_kaihuzh = value; }
        }

        /// <summary>
        ///     c_AccBank开户银行
        /// </summary>
        public string S_KAIHUYH
        {
            get { return m_str_s_kaihuyh; }
            set { m_str_s_kaihuyh = value; }
        }

        /// <summary>
        ///     i_tslx托收类型
        /// </summary>
        public decimal? I_TUOSHOULX
        {
            get { return m_dec_i_tuoshoulx; }
            set { m_dec_i_tuoshoulx = value; }
        }

        /// <summary>
        ///     i_tcbz剔除标志
        /// </summary>
        public decimal I_TICHUBZ
        {
            get { return m_dec_i_tichubz; }
            set { m_dec_i_tichubz = value; }
        }

        /// <summary>
        ///     i_Print
        /// </summary>
        public decimal? I_PRINT
        {
            get { return m_dec_i_print; }
            set { m_dec_i_print = value; }
        }

        /// <summary>
        ///     i_jlzt
        /// </summary>
        public decimal I_JLZT
        {
            get { return m_dec_i_jlzt; }
            set { m_dec_i_jlzt = value; }
        }

        /// <summary>
        ///     c_up
        /// </summary>
        public string S_UP
        {
            get { return m_str_s_up; }
            set { m_str_s_up = value; }
        }

        /// <summary>
        ///     c_down
        /// </summary>
        public string S_DOWN
        {
            get { return m_str_s_down; }
            set { m_str_s_down = value; }
        }

        /// <summary>
        ///     c_by1
        /// </summary>
        public string S_BEIYONG1
        {
            get { return m_str_s_beiyong1; }
            set { m_str_s_beiyong1 = value; }
        }

        /// <summary>
        ///     c_by2
        /// </summary>
        public string S_BEIYONG2
        {
            get { return m_str_s_beiyong2; }
            set { m_str_s_beiyong2 = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class YS_SF_QUXIAOTSTPRZProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public YS_SF_QUXIAOTSTPRZProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据YS_SF_QUXIAOTSTPRZ实体添加或者修改YS_SF_QUXIAOTSTPRZ信息
        /// </summary>
        public bool InsertOrUpdate(YS_SF_QUXIAOTSTPRZ YS_SF_QUXIAOTSTPRZ, OracleTransaction Transaction)
        {
            if (YS_SF_QUXIAOTSTPRZ.ID == 0)
                InsertYS_SF_QUXIAOTSTPRZ(YS_SF_QUXIAOTSTPRZ, Transaction);
            else
                UpdateYS_SF_QUXIAOTSTPRZ(YS_SF_QUXIAOTSTPRZ, Transaction);
            return YS_SF_QUXIAOTSTPRZ.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_SF_QUXIAOTSTPRZ实体添加或修改YS_SF_QUXIAOTSTPRZ信息
        /// </summary>
        public bool InsertOrUpdate(YS_SF_QUXIAOTSTPRZ YS_SF_QUXIAOTSTPRZ)
        {
            return InsertOrUpdate(YS_SF_QUXIAOTSTPRZ, null);
        }


        /// <summary>
        ///     根据YS_SF_QUXIAOTSTPRZ主键删除YS_SF_QUXIAOTSTPRZ信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_SF_QUXIAOTSTPRZ(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_SF_QUXIAOTSTPRZ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_SF_QUXIAOTSTPRZ主键删除YS_SF_QUXIAOTSTPRZ信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_SF_QUXIAOTSTPRZ(decimal ID)
        {
            return DeleteYS_SF_QUXIAOTSTPRZ(ID, null);
        }

        /// <summary>
        ///     根据条件删除YS_SF_QUXIAOTSTPRZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_SF_QUXIAOTSTPRZsDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_SF_QUXIAOTSTPRZsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除YS_SF_QUXIAOTSTPRZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_SF_QUXIAOTSTPRZsDynamic(string WhereClause)
        {
            return DeleteYS_SF_QUXIAOTSTPRZsDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据YS_SF_QUXIAOTSTPRZ主键选择YS_SF_QUXIAOTSTPRZ信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_SF_QUXIAOTSTPRZ信息</returns>
        public YS_SF_QUXIAOTSTPRZ SelectYS_SF_QUXIAOTSTPRZ(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_SF_QUXIAOTSTPRZ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var YS_SF_QUXIAOTSTPRZ = PopulateYS_SF_QUXIAOTSTPRZ(rd);
                rd.Close();
                return YS_SF_QUXIAOTSTPRZ;
            }
            return null;
        }

        /// <summary>
        ///     根据YS_SF_QUXIAOTSTPRZ主键选择YS_SF_QUXIAOTSTPRZ信息
        /// </summary>
        /// <returns>YS_SF_QUXIAOTSTPRZ信息</returns>
        public YS_SF_QUXIAOTSTPRZ SelectYS_SF_QUXIAOTSTPRZ(decimal ID)
        {
            return SelectYS_SF_QUXIAOTSTPRZ(ID, null);
        }

        /// <summary>
        ///     选择所有YS_SF_QUXIAOTSTPRZ信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有YS_SF_QUXIAOTSTPRZ信息</returns>
        public DataTable SelectYS_SF_QUXIAOTSTPRZsAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_SF_QUXIAOTSTPRZsAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }

        /// <summary>
        ///     选择所有YS_SF_QUXIAOTSTPRZ信息
        /// </summary>
        /// <returns>所有YS_SF_QUXIAOTSTPRZ信息</returns>
        public DataTable SelectYS_SF_QUXIAOTSTPRZsAll()
        {
            return SelectYS_SF_QUXIAOTSTPRZsAll(null);
        }

        /// <summary>
        ///     根据条件选择YS_SF_QUXIAOTSTPRZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_SF_QUXIAOTSTPRZ信息</returns>
        public DataTable SelectYS_SF_QUXIAOTSTPRZsDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_SF_QUXIAOTSTPRZsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_SF_QUXIAOTSTPRZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>YS_SF_QUXIAOTSTPRZ信息</returns>
        public DataTable SelectYS_SF_QUXIAOTSTPRZsDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectYS_SF_QUXIAOTSTPRZsDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择YS_SF_QUXIAOTSTPRZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_SF_QUXIAOTSTPRZ信息</returns>
        public DataTable SelectYS_SF_QUXIAOTSTPRZsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_SF_QUXIAOTSTPRZsDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_SF_QUXIAOTSTPRZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>YS_SF_QUXIAOTSTPRZ信息</returns>
        public DataTable SelectYS_SF_QUXIAOTSTPRZsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectYS_SF_QUXIAOTSTPRZsDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新YS_SF_QUXIAOTSTPRZ字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_SF_QUXIAOTSTPRZsDynamic(string UpdateValue, string WhereClause,
            OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "")
                return 0;
            var spName = "CS_UpdYS_SF_QUXIAOTSTPRZDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新YS_SF_QUXIAOTSTPRZ字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_SF_QUXIAOTSTPRZsDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateYS_SF_QUXIAOTSTPRZsDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertYS_SF_QUXIAOTSTPRZ(YS_SF_QUXIAOTSTPRZ YS_SF_QUXIAOTSTPRZ, OracleTransaction Transaction)
        {
            var spName = "CS_InsYS_SF_QUXIAOTSTPRZ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_SF_QUXIAOTSTPRZ.D_QUXIAORQ;
            storedParams[1].Value = YS_SF_QUXIAOTSTPRZ.I_CHULIR;
            storedParams[2].Value = YS_SF_QUXIAOTSTPRZ.I_TUOSHOUPZH;
            storedParams[3].Value = YS_SF_QUXIAOTSTPRZ.I_HUIZHONGBH;
            storedParams[4].Value = YS_SF_QUXIAOTSTPRZ.S_ZHANDIANBH;
            storedParams[5].Value = YS_SF_QUXIAOTSTPRZ.I_FEIYONGBH;
            storedParams[6].Value = YS_SF_QUXIAOTSTPRZ.S_YONGHUH;
            storedParams[7].Value = YS_SF_QUXIAOTSTPRZ.S_GUANLIKBH;
            storedParams[8].Value = YS_SF_QUXIAOTSTPRZ.I_Y;
            storedParams[9].Value = YS_SF_QUXIAOTSTPRZ.I_M;
            storedParams[10].Value = YS_SF_QUXIAOTSTPRZ.S_YONGHUM;
            storedParams[11].Value = YS_SF_QUXIAOTSTPRZ.N_JINE;
            storedParams[12].Value = YS_SF_QUXIAOTSTPRZ.S_KAIHUHM;
            storedParams[13].Value = YS_SF_QUXIAOTSTPRZ.S_KAIHUZH;
            storedParams[14].Value = YS_SF_QUXIAOTSTPRZ.S_KAIHUYH;
            storedParams[15].Value = YS_SF_QUXIAOTSTPRZ.I_TUOSHOULX;
            storedParams[16].Value = YS_SF_QUXIAOTSTPRZ.I_TICHUBZ;
            storedParams[17].Value = YS_SF_QUXIAOTSTPRZ.I_PRINT;
            storedParams[18].Value = YS_SF_QUXIAOTSTPRZ.I_JLZT;
            storedParams[19].Value = YS_SF_QUXIAOTSTPRZ.S_UP;
            storedParams[20].Value = YS_SF_QUXIAOTSTPRZ.S_DOWN;
            storedParams[21].Value = YS_SF_QUXIAOTSTPRZ.S_BEIYONG1;
            storedParams[22].Value = YS_SF_QUXIAOTSTPRZ.S_BEIYONG2;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            YS_SF_QUXIAOTSTPRZ.ID = Convert.ToInt32(storedParams[23].Value);
            return result;
        }

        private bool UpdateYS_SF_QUXIAOTSTPRZ(YS_SF_QUXIAOTSTPRZ YS_SF_QUXIAOTSTPRZ, OracleTransaction Transaction)
        {
            var spName = "CS_UpdYS_SF_QUXIAOTSTPRZ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_SF_QUXIAOTSTPRZ.D_QUXIAORQ;
            storedParams[1].Value = YS_SF_QUXIAOTSTPRZ.I_CHULIR;
            storedParams[2].Value = YS_SF_QUXIAOTSTPRZ.I_TUOSHOUPZH;
            storedParams[3].Value = YS_SF_QUXIAOTSTPRZ.I_HUIZHONGBH;
            storedParams[4].Value = YS_SF_QUXIAOTSTPRZ.S_ZHANDIANBH;
            storedParams[5].Value = YS_SF_QUXIAOTSTPRZ.I_FEIYONGBH;
            storedParams[6].Value = YS_SF_QUXIAOTSTPRZ.S_YONGHUH;
            storedParams[7].Value = YS_SF_QUXIAOTSTPRZ.S_GUANLIKBH;
            storedParams[8].Value = YS_SF_QUXIAOTSTPRZ.I_Y;
            storedParams[9].Value = YS_SF_QUXIAOTSTPRZ.I_M;
            storedParams[10].Value = YS_SF_QUXIAOTSTPRZ.S_YONGHUM;
            storedParams[11].Value = YS_SF_QUXIAOTSTPRZ.N_JINE;
            storedParams[12].Value = YS_SF_QUXIAOTSTPRZ.S_KAIHUHM;
            storedParams[13].Value = YS_SF_QUXIAOTSTPRZ.S_KAIHUZH;
            storedParams[14].Value = YS_SF_QUXIAOTSTPRZ.S_KAIHUYH;
            storedParams[15].Value = YS_SF_QUXIAOTSTPRZ.I_TUOSHOULX;
            storedParams[16].Value = YS_SF_QUXIAOTSTPRZ.I_TICHUBZ;
            storedParams[17].Value = YS_SF_QUXIAOTSTPRZ.I_PRINT;
            storedParams[18].Value = YS_SF_QUXIAOTSTPRZ.I_JLZT;
            storedParams[19].Value = YS_SF_QUXIAOTSTPRZ.S_UP;
            storedParams[20].Value = YS_SF_QUXIAOTSTPRZ.S_DOWN;
            storedParams[21].Value = YS_SF_QUXIAOTSTPRZ.S_BEIYONG1;
            storedParams[22].Value = YS_SF_QUXIAOTSTPRZ.S_BEIYONG2;
            storedParams[23].Value = YS_SF_QUXIAOTSTPRZ.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private YS_SF_QUXIAOTSTPRZ PopulateYS_SF_QUXIAOTSTPRZ(IDataReader dr)
        {
            var YS_SF_QUXIAOTSTPRZ = new YS_SF_QUXIAOTSTPRZ();
            YS_SF_QUXIAOTSTPRZ.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            YS_SF_QUXIAOTSTPRZ.D_QUXIAORQ = dr["D_QUXIAORQ"] == DBNull.Value
                ? Convert.ToDateTime("1900-1-1")
                : (DateTime) dr["D_QUXIAORQ"];
            YS_SF_QUXIAOTSTPRZ.I_CHULIR = dr["I_CHULIR"] == DBNull.Value ? 0 : (decimal) dr["I_CHULIR"];
            YS_SF_QUXIAOTSTPRZ.I_TUOSHOUPZH = dr["I_TUOSHOUPZH"] == DBNull.Value ? 0 : (decimal) dr["I_TUOSHOUPZH"];
            YS_SF_QUXIAOTSTPRZ.I_HUIZHONGBH = dr["I_HUIZHONGBH"] == DBNull.Value ? 0 : (decimal) dr["I_HUIZHONGBH"];
            YS_SF_QUXIAOTSTPRZ.S_ZHANDIANBH = dr["S_ZHANDIANBH"] == DBNull.Value ? "" : (string) dr["S_ZHANDIANBH"];
            YS_SF_QUXIAOTSTPRZ.I_FEIYONGBH = dr["I_FEIYONGBH"] == DBNull.Value ? 0 : (decimal) dr["I_FEIYONGBH"];
            YS_SF_QUXIAOTSTPRZ.S_YONGHUH = dr["S_YONGHUH"] == DBNull.Value ? "" : (string) dr["S_YONGHUH"];
            YS_SF_QUXIAOTSTPRZ.S_GUANLIKBH = dr["S_GUANLIKBH"] == DBNull.Value ? "" : (string) dr["S_GUANLIKBH"];
            YS_SF_QUXIAOTSTPRZ.I_Y = dr["I_Y"] == DBNull.Value ? 0 : (decimal) dr["I_Y"];
            YS_SF_QUXIAOTSTPRZ.I_M = dr["I_M"] == DBNull.Value ? 0 : (decimal) dr["I_M"];
            YS_SF_QUXIAOTSTPRZ.S_YONGHUM = dr["S_YONGHUM"] == DBNull.Value ? null : (string) dr["S_YONGHUM"];
            YS_SF_QUXIAOTSTPRZ.N_JINE = dr["N_JINE"] == DBNull.Value ? null : (double?) dr["N_JINE"];
            YS_SF_QUXIAOTSTPRZ.S_KAIHUHM = dr["S_KAIHUHM"] == DBNull.Value ? null : (string) dr["S_KAIHUHM"];
            YS_SF_QUXIAOTSTPRZ.S_KAIHUZH = dr["S_KAIHUZH"] == DBNull.Value ? null : (string) dr["S_KAIHUZH"];
            YS_SF_QUXIAOTSTPRZ.S_KAIHUYH = dr["S_KAIHUYH"] == DBNull.Value ? null : (string) dr["S_KAIHUYH"];
            YS_SF_QUXIAOTSTPRZ.I_TUOSHOULX = dr["I_TUOSHOULX"] == DBNull.Value ? null : (decimal?) dr["I_TUOSHOULX"];
            YS_SF_QUXIAOTSTPRZ.I_TICHUBZ = dr["I_TICHUBZ"] == DBNull.Value ? 0 : (decimal) dr["I_TICHUBZ"];
            YS_SF_QUXIAOTSTPRZ.I_PRINT = dr["I_PRINT"] == DBNull.Value ? null : (decimal?) dr["I_PRINT"];
            YS_SF_QUXIAOTSTPRZ.I_JLZT = dr["I_JLZT"] == DBNull.Value ? 0 : (decimal) dr["I_JLZT"];
            YS_SF_QUXIAOTSTPRZ.S_UP = dr["S_UP"] == DBNull.Value ? null : (string) dr["S_UP"];
            YS_SF_QUXIAOTSTPRZ.S_DOWN = dr["S_DOWN"] == DBNull.Value ? null : (string) dr["S_DOWN"];
            YS_SF_QUXIAOTSTPRZ.S_BEIYONG1 = dr["S_BEIYONG1"] == DBNull.Value ? null : (string) dr["S_BEIYONG1"];
            YS_SF_QUXIAOTSTPRZ.S_BEIYONG2 = dr["S_BEIYONG2"] == DBNull.Value ? null : (string) dr["S_BEIYONG2"];
            return YS_SF_QUXIAOTSTPRZ;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++)
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion